import Vue from 'vue'

import 'normalize.css/normalize.css' // A modern alternative to CSS resets

import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import locale from 'element-ui/lib/locale/lang/en' // lang i18n
import 'babel-polyfill' // 用于IE支持
import '@/styles/index.scss' // global css

import App from './App'
import router from './router'
import store from './store'

import '@/icons' // icon
import '@/permission' // permission control
import * as filters from './filters' // global filters


import vuePicturePreview from 'vue-picture-preview'
import echarts from 'echarts'

// 将echarts挂载到prototype上，在组件中可以直接使用this.echarts访问
Vue.prototype.$echarts = echarts

import axios from './utils/request'
// 将axios挂载到prototype上，在组件中可以直接使用this.axios访问
Vue.prototype.axios = axios

Vue.use(ElementUI, { locale })
Vue.use(vuePicturePreview)

// register global utility filters.
Object.keys(filters).forEach(key => {
  Vue.filter(key, filters[key])
})

Vue.config.productionTip = false

new Vue({
  el: '#app',
  router,
  store,
  render: h => h(App)
})
